package com.Txunda.fxw.ui.http;

import com.Txunda.fxw.base.web.ApiListener;
import com.Txunda.fxw.base.web.ApiTool;
import com.Txunda.fxw.ui.toolkit.config.Config;
import com.lidroid.xutils.http.RequestParams;

public class Company {
	public void companyList(String lat, String lnt, int p, String class_id, String district_id, String city_id,
			String province_id, ApiListener apiListener) {
		RequestParams params = new RequestParams();
		ApiTool apiTool = new ApiTool();
		params.addQueryStringParameter("lat", lat);
		params.addQueryStringParameter("lnt", lnt);
		params.addQueryStringParameter("p", String.valueOf(p));
		params.addQueryStringParameter("class_id", class_id);
		params.addQueryStringParameter("district_id", district_id);
		params.addQueryStringParameter("city_id", city_id);
		params.addQueryStringParameter("province_id", province_id);
		apiTool.getApi(Config.BASE_URL + "Company/companyList", params, apiListener);
	}

	public void companyDetail(String com_id, String class_id, ApiListener apiListener) {
		RequestParams params = new RequestParams();
		ApiTool apiTool = new ApiTool();
		params.addQueryStringParameter("com_id", com_id);
		params.addQueryStringParameter("class_id", class_id);
		apiTool.getApi(Config.BASE_URL + "Company/companyDetail", params, apiListener);

	}

	public void summary(String class_id, ApiListener apiListener) {
		RequestParams params = new RequestParams();
		ApiTool apiTool = new ApiTool();
		params.addQueryStringParameter("class_id", class_id);
		apiTool.getApi(Config.BASE_URL + "Company/summary", params, apiListener);
	}

	public void collectList(String json, int p, ApiListener apiListener) {
		RequestParams params = new RequestParams();
		ApiTool apiTool = new ApiTool();
		if (json != null && !json.equals("")) {
			params.addQueryStringParameter("json", json);
		}
		params.addQueryStringParameter("p", p + "");
		apiTool.getApi(Config.BASE_URL + "Company/collectList", params, apiListener);

	}

	public void summaryCity(String class_id, String province_id, ApiListener apiListener) {
		RequestParams params = new RequestParams();
		ApiTool apiTool = new ApiTool();
		params.addQueryStringParameter("class_id", class_id);
		params.addQueryStringParameter("province_id", province_id);
		apiTool.getApi(Config.BASE_URL + "Company/summaryCity", params, apiListener);
	}

	public void summaryDistrict(String class_id, String city_id, ApiListener apiListener) {
		RequestParams params = new RequestParams();
		ApiTool apiTool = new ApiTool();
		params.addQueryStringParameter("class_id", class_id);
		params.addQueryStringParameter("city_id", city_id);
		apiTool.getApi(Config.BASE_URL + "Company/summaryDistrict", params, apiListener);
	}

}
